package src.main.java.org.io;

import java.io.*;

/*
* 字符输入转换流：InputStreamReader
* */
public class Test11 {
    public static void main(String[] args) {
        try(
                //1.得到文件的原始字节流（GBK的字节流形式）
                FileInputStream fileInputStream = new FileInputStream("E:\\JavaLearn\\javaCode\\src\\test6.txt");
                //2.把原始的字节输入流按照指定的字符集编码转换成字符输入流
                Reader isr = new InputStreamReader(fileInputStream,"GBK");
                BufferedReader bufferedReader = new BufferedReader(isr)
        ) {
           String line;
           while((line = bufferedReader.readLine())!=null){
               System.out.println(line);
           }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
